<template>
<div class="bg-white bg-newcolor">
  <!-- <img src="../../../static/images/img/lvcaijia.jpg" alt="" class="company-banner"> -->
  <img :src="blueshoppage.banner" alt="" class="company-banner">
  <div class="container blueshoppage">
    <div class="blueshoppage-top clearfix">
        <img :src="blueshoppage.logo" alt="" class="fl">
        <ul class="clearfix fl">
          <li>企业介绍</li>
          <li>企业档案</li>
          <li>产品橱窗</li>
          <li>联系方式</li>
        </ul>
    </div>
    <div class="blueshoppage-content clearfix mgt-30">
      <div class="fl blueshoppage-content-left">
        <div class="shopFileBg">
          <p class="title">供应商档案</p>
          <ul class="blueshoppage-content-file">
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">商家名称：</p>
              <p class="fl">{{blueshoppage.full_name}}</p>
            </li>
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">绿采等级：</p>
              <p class="fl"><i class="el-icon-star-on" v-for="index in blueshoppage.rate" :key="index"></i></p>
            </li>
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">经营模式：</p>
              <!-- <p class="fl">{{blueshoppage.merchant_type|filterMerchant_type}}</p> -->
              <p class="fl">{{blueshoppage.merchant_type_text}}</p>
            </li>
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">认证信息：</p>
              <p class="fl">
                <ul>
                  <li v-for="(item,index) in blueshoppage.certification_info" :key="index" v-if="index<3">{{item.title}}</li>
                </ul>
              </p>
            </li>
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">所在地区：</p>
              <p class="fl">{{blueshoppage.address}}</p>
            </li>
            <li class="clearfix">
              <p class="fl blueshoppage-content-file-text">联系电话：</p>
              <!-- <p class="fl"><router-link to="">点击查看</router-link></p> -->
              <p class="fl">{{blueshoppage.mobile}}</p>
            </li>
          </ul>
        </div>
        <div class="blueshoppage-content-product">
          <p class="name">经营产品分类</p>
          <ul>
            <li v-for="(item,index) in blueshoppageProduct" :key="index"><router-link to="/Blueshoppage_list">{{item.title}}</router-link></li>
          </ul>
        </div>
      </div>
      <div class="fl blueshoppage-content-right">
        <div class="company-intro">
          <p class="title">企业介绍</p>
          <p class="intro">{{blueshoppage.introduction}}</p>
          <div class="clearfix companyimg">
            <img :src="blueshoppage.images" alt="">
            <!-- <img src="../../../static/images/img/lvcaijia.jpg" alt=""> -->
          </div>
        </div>
        <div class="product">
          <div class="clearfix name">
            <p>产品橱窗</p>
            <router-link to="">>>>更多</router-link>
          </div>
          <ul class="product-list clearfix">
            <li v-for="(item,index) in productBoxList" :key="index" v-if="index<4">
              <router-link to="">
                <!-- <img src="../../../static/images/img/lvcaijia.jpg" alt=""> -->
                <img :src="item.logo" alt="">
                <p class="product-list-title">{{item.title}}</p>
                <p>价格：<span class="loginSeeStyle">登录查看</span></p>
              </router-link>
            </li>
            <!-- <li>
              <router-link to="">
                <img src="../../../static/images/img/lvcaijia.jpg" alt="">
                <p>产品标题</p>
                <p>价格：<span class="loginSeeStyle">登录查看</span></p>
              </router-link>
            </li>
            <li>
              <router-link to="">
                <img src="../../../static/images/img/lvcaijia.jpg" alt="">
                <p>产品标题</p>
                <p>价格：<span class="loginSeeStyle">登录查看</span></p>
              </router-link>
            </li>
            <li>
              <router-link to="">
                <img src="../../../static/images/img/lvcaijia.jpg" alt="">
                <p>产品标题</p>
                <p>价格：<span class="loginSeeStyle">登录查看</span></p>
              </router-link>
            </li> -->
          </ul>
        </div>
        <div class="com-document">
          <p class="document">企业档案</p>
          <ul class="clearfix">
            <li><p>注册资本：<span class="mgl-30">{{companyDetail.registered_capital}}万</span></p></li>
            <li><p>成立年份：<span class="mgl-30">{{companyDetail.found_time}}</span></p></li>
            <li><p>纳税人类型：<span class="mgl-30">{{companyDetail.taxpayer_type}}</span></p></li>
            <li><p>注册地址：<span class="mgl-30">{{companyDetail.register_address}}</span></p></li>
            <li><p>经营状态：<span class="mgl-30">{{companyDetail.business_status}}</span></p></li>
            <li><p>所属行业：<span class="mgl-30">{{companyDetail.industry}}</span></p></li>
            <li><p><router-link to="">查看工商资质</router-link></p></li>
          </ul>
        </div>
        <div class="link-type">
          <p class="type">联系方式</p>
          <div>
            <p class="com-type">企业联系方式</p>
            <ul class="type-list">
              <li class="clearfix"><p class="fl">企业名称</p><p class="fl">{{blueshoppage.full_name}}</p></li>
              <li class="clearfix" v-if="loginfag == false"><p class="fl">公司联系人</p><p class="fl loginSeeStyle">登录后可查看</p></li>
              <li class="clearfix" v-if="loginfag == true"><p class="fl">公司联系人</p><p class="fl loginSeeStyle">{{blueshoppage.contact}}</p></li>
              <li class="clearfix" v-if="loginfag == false"><p class="fl">公司地址</p><p class="fl loginSeeStyle">登录后可查看</p></li>
              <li class="clearfix" v-if="loginfag == true"><p class="fl">公司地址</p><p class="fl loginSeeStyle">{{blueshoppage.address}}</p></li>
              <li class="clearfix" v-if="loginfag == false"><p class="fl">联系电话</p><p class="fl loginSeeStyle">登录后可查看</p></li>
              <li class="clearfix" v-if="loginfag == true"><p class="fl">联系电话</p><p class="fl loginSeeStyle">{{blueshoppage.mobile}}</p></li>
            </ul>
          </div>
          <div class="mgt-20">
            <p class="com-type">公司战略联系人</p>
            <ul>
              <li v-for="(item,index) in contactlist" :key="index" v-if="index<4">
                <ul class="type-list">
                  <li class="clearfix"><p class="fl">负责区域</p><p class="fl">{{item.region}}</p></li>
                  <li class="clearfix" v-if="loginfag == false"><p class="fl">姓名</p><p class="fl clearfix">周<span class="mgl-30 fr pointer loginSeeStyle">点击查看</span></p></li>
                  <li class="clearfix" v-if="loginfag == true"><p class="fl">姓名</p><p class="fl clearfix">{{item.name}}</p></li>
                  <li class="clearfix" v-if="loginfag == false"><p class="fl">手机号码</p><p class="fl clearfix">156********<span class="mgl-30 fr pointer loginSeeStyle">点击查看</span></p></li>
                  <li class="clearfix" v-if="loginfag == true"><p class="fl">手机号码</p><p class="fl clearfix">{{item.mobile}}</p></li>
                  <li class="clearfix" v-if="loginfag == false"><p class="fl">邮箱</p><p class="fl clearfix">6732*********<span class="mgl-30 fr pointer loginSeeStyle">点击查看</span></p></li>
                  <li class="clearfix" v-if="loginfag == true"><p class="fl">邮箱</p><p class="fl clearfix">{{item.email}}</p></li>
                </ul>
              </li>
            </ul>
          </div>
        </div>
        <div class="map">
          <p class="map-text">蔚蓝地图</p>
          <div>
            <div class="border-zhanwei"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</template>


<script>
import jquery from '../../assets/js/jquery-1.10.2.min.js'
import axios from 'axios'
export default {
  name:'Blueshoppage',
  filters:{
    // 经营模式数据过滤
    filterMerchant_type(value){
      if(value == 1){
        return "生产型企业"
      } else if(value == 2){
        return "代加工型企业"
      } else if(value == 3){
        return "贸易型企业"
      }
    },
    // 经营模式数据过滤
    filterMerchant_type(value){
      if(value == 1){
        return "生产型企业"
      } else if(value == 2){
        return "代加工型企业"
      } else if(value == 3){
        return "贸易型企业"
      }
    }
  },
  data(){
      return{
        blueshoppage:{},
        blueshoppageProduct:[],
        indexShopId:'',
        shoppagelist:{},
        mechant_id:'',
        productBoxList:[],
        contactlist:[],
        companyDetail:{},
        loginfag:true
      }
  },
  methods:{
    // 绿色商户详情
    getBlueshoppage () {
      var that=this
      axios.get('/merchant/businessCategory2')
      .then(function(res){
        res = res.data
        that.blueshoppage = res.response,
        that.contactlist = res.response.strategy_contact_info
      })
    },
    // 绿色商户详情-经营的产品分类
    getBlueshoppageProduct () {
      var that=this
      axios.get('/merchant/businessCategory')
      .then(function(res){
        res = res.data
        that.blueshoppageProduct = res.response
      })
    },
    // 产品橱窗接口 接产品列表 ,{params:{mechant_id:1}}
    getproductBoxList(){
      var that=this
      axios.get('/product/list')
      .then(function(res){
        res = res.data
        that.productBoxList = res.response
      })
    },
    //   参数 ,{params:{id:that.shoppagelist.id}}
      getContactDetail () {
      var that=this
      axios.get('/merchant/contacts')
      .then(function(res){
        res = res.data
        that.contactDetail = res.response
      })
    },
    //   参数 ,{params:{id:that.shoppagelist.id}}
      getCompanyDetail () {
      var that=this
      axios.get('/merchant/archive')
      .then(function(res){
        res = res.data
        that.companyDetail = res.response
      })
    },
  },
  created:function () {
    this.getBlueshoppageProduct();
    this.getBlueshoppage();
    this.getproductBoxList();
    this.getCompanyDetail();
    this.$emit('public_header', false);
    this.$emit('public_headerhover', true);
    this.$emit('public_footer', true);
    this.indexShopId = this.$route.params.id;
    console.log(this.indexShopId)
  },
  mounted(){
    // 解决传过来的参数值在刷新页面后丢失
    this.shoppagelist = JSON.parse(this.$route.params.shoppagelist)
  }
}
</script>

<style>
 @import '../../../static/style/blueshoppage';
</style>
